package development.hdk.node;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.view.View;
import android.widget.RelativeLayout.LayoutParams;
import java.util.LinkedList;
import development.hdk.mindmapfornandroid.Attributes;
import development.hdk.mindmapfornandroid.CommonResources;;

public class Node extends View
{
  protected static final int borderSize = 5;
  protected static final String defaultTextSize = "K|p";
  protected static final int textPadding = 2;
  protected static final int textSize = 30;
  public Attributes attributes;
  protected Paint backgroundPaint = new Paint(1);
  protected Paint borderPaint = new Paint(1);
  protected LinkedList<Node> children = new LinkedList();
  public CommonResources commonResources;
  protected int height = 0;
  protected Bitmap icon = null;
  protected int id;
  protected boolean isFocused = false;
  public Line line;
  protected float locationX;
  protected float locationY;
  protected Node parent = null;
  protected Paint shadowPaint = new Paint(1);
  protected String text = "";
  public Paint textPaint = new Paint(1);
  protected int width = 0;
  protected int x;
  protected int y;

  public Node(Context paramContext)
  {
    super(paramContext);
  }

  public Node(Context paramContext, float paramFloat1, float paramFloat2, int paramInt, Node paramNode, Attributes paramAttributes, CommonResources paramCommonResources)
  {
    super(paramContext);
    this.locationX = paramFloat1;
    this.locationY = paramFloat2;
    this.commonResources = paramCommonResources;
    this.x = paramCommonResources.pixelCoordinateX(paramFloat1);
    this.y = paramCommonResources.pixelCoordinateY(paramFloat2);
    this.id = paramInt;
    this.parent = paramNode;
    this.attributes = paramAttributes;
    setIcon(paramAttributes.getShowIcon());
    this.shadowPaint.setColor(Color.parseColor("#33B5E5"));
    this.textPaint.setTypeface(Typeface.DEFAULT_BOLD);
  }

  public Node(Context paramContext, int paramInt1, int paramInt2, int paramInt3, Node paramNode, CommonResources paramCommonResources, Attributes paramAttributes)
  {
    super(paramContext);
    this.commonResources = paramCommonResources;
    this.x = paramInt1;
    this.y = paramInt2;
    this.locationX = paramCommonResources.floatCoordinateX(paramInt1);
    this.locationY = paramCommonResources.floatCoordinateY(paramInt2);
    this.id = paramInt3;
    this.parent = paramNode;
    this.attributes = paramAttributes;
    setIcon(paramAttributes.getShowIcon());
    this.shadowPaint.setColor(Color.parseColor("#33B5E5"));
    this.textPaint.setTypeface(Typeface.DEFAULT_BOLD);
  }

  public Node(Context paramContext, Node paramNode)
  {
    super(paramContext);
    this.commonResources = paramNode.commonResources;
    this.x = paramNode.getNodeX();
    this.y = paramNode.getNodeY();
    this.locationX = this.commonResources.floatCoordinateX(this.x);
    this.locationY = this.commonResources.floatCoordinateY(this.y);
    this.id = paramNode.getID();
    this.parent = paramNode.getParentNode();
    //if (this.line != null)
    //  this.line.parent = paramNode.getParentNode();
   // this.attributes = paramNode.attributes;
    this.children = paramNode.getChildren();
    this.text = paramNode.getText();
    //setIcon(this.attributes.getShowIcon());
    for (int i = 0; ; i++)
    {
      if (i >= this.children.size())
      {
        this.shadowPaint.setColor(Color.parseColor("#33B5E5"));
        this.textPaint.setTypeface(Typeface.DEFAULT_BOLD);
        return;
      }
      ((Node)this.children.get(i)).setParent(this);
    }
  }

  public void addChild(Node paramNode)
  {
    this.children.add(paramNode);
  }

  public boolean doesIntersect(int paramInt1, int paramInt2)
  {
    return false;
  }

  public LinkedList<Node> getChildren()
  {
    return (LinkedList)this.children.clone();
  }

  public int getID()
  {
    return this.id;
  }

  public Point getLineConnection(float paramFloat1, float paramFloat2)
  {
    return new Point();
  }

  public float getLocationX()
  {
    return this.locationX;
  }

  public float getLocationY()
  {
    return this.locationY;
  }

  public Rect getNodeBounds()
  {
    return new Rect();
  }

  public int getNodeHeight()
  {
    return this.height;
  }

  public int getNodeWidth()
  {
    return this.width;
  }

  public int getNodeX()
  {
    return this.x;
  }

  public int getNodeY()
  {
    return this.y;
  }

  public Node getParentNode()
  {
    return this.parent;
  }

  public String getText()
  {
    return this.text;
  }

  public void move(float paramFloat1, float paramFloat2)
  {
    this.x += Math.round(paramFloat1);
    this.y += Math.round(paramFloat2);
  }

  protected void onDraw(Canvas paramCanvas)
  {
    super.onDraw(paramCanvas);
  }

  protected void onMeasure(int paramInt1, int paramInt2)
  {
    setMeasuredDimension(0, 0);
  }

  public void recycleAllNodes()
  {
    if (this.icon != null)
      this.icon.recycle();
    for (int i = 0; ; i++)
    {
      if (i >= this.children.size())
        return;
      ((Node)this.children.get(i)).recycleAllNodes();
    }
  }

  public void removeChild(Node paramNode)
  {
    this.children.remove(paramNode);
  }

  public void setFloatLocation(float paramFloat1, float paramFloat2)
  {
    this.locationX = paramFloat1;
    this.locationY = paramFloat2;
  }

  public void setFocus(boolean paramBoolean)
  {
    this.isFocused = paramBoolean;
  }

  public void setIcon(boolean paramBoolean)
  {
    
  }

  public void setIntLocation(int paramInt1, int paramInt2)
  {
    this.x = paramInt1;
    this.y = paramInt2;
  }

  public void setParent(Node paramNode)
  {
    
  }

  public void setStyle(int paramInt1, int paramInt2)
  {
    
  }

  public void setText(String paramString)
  {
    this.text = paramString;
  }

  public void updateAllLayout()
  {
    updateLayoutParams();
    for (int i = 0; ; i++)
    {
      if (i >= this.children.size())
        return;
      ((Node)this.children.get(i)).updateAllLayout();
    }
  }

  public void updateLayoutParams()
  {
    
  }

  public void updateLayoutParams(int paramInt1, int paramInt2)
  {
    
  }
}

/* Location:           D:\APKtoJava_RC2\tools\classes-dex2jar.jar
 * Qualified Name:     com.qdvsoftworks.schematicmind.nodes.Node
 * JD-Core Version:    0.6.0
 */